package com.bone.eventsweb.controller;
import java.util.Arrays;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.bone.eventsweb.entity.CasesharingEntity;
import com.bone.eventsweb.service.CasesharingService;
import com.bone.eventsweb.utils.PageUtils;
import com.bone.eventsweb.utils.R;



/**
 * 
 *
 * @author dkx
 * @email null
 * @date 2024-02-26 15:06:22
 */
@RestController
@RequestMapping("eventsweb/casesharing")
public class CasesharingController {
    @Autowired

    private CasesharingService casesharingService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = casesharingService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Integer id){
		CasesharingEntity casesharing = casesharingService.getById(id);

        return R.ok().put("casesharing", casesharing);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody CasesharingEntity casesharing){
		casesharingService.save(casesharing);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody CasesharingEntity casesharing){
		casesharingService.updateById(casesharing);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Integer[] ids){
		casesharingService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
